<?php $this->load->view('scenic/layout/header') ?>
<div class="widthMax">
    <header class="sales-head">
        <img class="lazy" src="/skins/scenic/images/load.jpg" data-original="images/zhuanqu.jpg">
        <div class="sales-page">
            <a href="javascript:goHistoryBack('<?php echo site_url('scenic/home/index');?>');">
                <i class="iconfont">&#xe606;</i>
            </a>
            <div class="sales-location">
                <i class="iconfont">&#xe600;</i><?php echo $region_name;?>
            </div>
            <a href="<?php echo site_url('home/ucenter/index');?>" class="sales-share">
                <i class="iconfont">&#xe62b;</i>
            </a>
        </div>
        <div class="sales-backdrop"></div>
    </header>
    <section class="sales-sect">
        <div class="scenic-emx" data-am-sticky="{animation: 'slide-top'}">
            <div class="am-cf scenic-sity">
                <p>选择您身边的省市</p>
                <div id="doc-dropdown-justify" class="scen-right">
                    <div class="am-dropdown" data-am-dropdown="{justify: '#doc-dropdown-justify'}">
                    <button class="am-btn am-btn-success am-dropdown-toggle"><?php echo $region_name;?>
                        <div class="scenic-sub">
                            <i class="isub"></i>
                        </div>
                    </button>
                    <div class="am-dropdown-content">
                        <ul class="clearfix">
                            <?php foreach ($sceneryRegion as $province) :?>
                            <li <?php if ($province->region_name==$region_name) :?>class="active"<?php endif;?>>
                                <a href="<?php echo site_url('scenic/info/zhuanqu/'.$province->region_pinyin);?>"><?php echo $province->region_name;?></a>
                            </li>
                            <?php endforeach;?>
                        </ul>
                    </div>
                  </div>
                </div>
            </div>
            <div class="wamp">
                <div class="iscoll">
                    <ul class="am-cf scenic-num">
                    <?php $i=1;foreach ($getSceneryList as $key=>$city):?>
                        <?php if ($cityName = array_search($key, $citys)) :?>
                            <li <?php if ($i==1) :?>class="active"<?php endif;?>>
                                <a href="#cityid<?php echo $key?>"><?php echo $cityName?></a>
                            </li>
                        <?php $i++;endif;?>
                    <?php endforeach;?>
                    </ul>
                </div>
            </div>
        </div>
        <?php if (count($sceneryListAll) > 3) :?>
            <div class="sales-text">
                <div class="hotlass">
                    <i>景区门票</i>
                    <span></span>
                </div>
                <ul class="sales-product">
                    <?php foreach ($sceneryListAll as $kk=>$vv):?>
                        <?php if ($kk <= 2 || $kk%3 == 1) continue; //随机取三条数据?>
                        <li class="<?php echo $kk;?>">
                            <img class="lazy" src="/skins/scenic/images/load.jpg" data-original="<?php echo $this->config->show_image_url($vv->minipics); ?>">
                            <div class="sales-button am-cf">
                                <div class="button-left">
                                    <h4><?php echo $vv->name_hanzi?></h4>
                                    <i><span>￥</span><?php echo $vv->shop_price;?>起</i>
                                    <s><span>￥</span><?php echo $vv->market_price;?></s>
                                </div>
                                <div class="button-right">
                                    <a href="<?php echo site_url('scenic/info/index/'.$vv->sid); ?>">立即购买</a>
                                </div>
                            </div>
                        </li>
                        <?php if ($kk == 6) break;?>
                    <?php endforeach;?>
                </ul>
            </div>
        <?php endif;?>
        <?php if (count($getSceneryList) > 0) :?>
            <div class="sales-text">
                <div class="hotlass">
                    <i>热门推荐</i>
                    <span></span>
                </div>
                <ul class="sales-remcon am-cf">
                <?php foreach ($getSceneryList as $kk=>$vv):?>
                    <?php $j=1;foreach ($vv as $k=>$v):?>
                    <li <?php if ($j==1) :?>id="cityid<?php echo $kk?>"<?php endif;?>>
                        <a href="<?php echo site_url('scenic/info/index/'.$v->sid); ?>">
                            <img class="lazy" src="/skins/scenic/images/load.jpg" data-original="<?php echo $this->config->show_image_url($v->minipics); ?>">
                            <div class="sales-price">
                                <h4><?php echo $v->name_hanzi?></h4>
                                <i><span>￥</span><?php echo $v->shop_price;?>起</i>
                            </div>
                        </a>
                    </li>
                    <?php $j++;endforeach;?>
                <?php endforeach;?>
                </ul>
            </div>
        <?php endif;?>
    </section>
</div>
<?php $this->load->view('scenic/layout/footer') ?>
<script type="text/javascript">
    $(function(){
        var IScroll = $.AMUI.iScroll;
        var myScroll = new IScroll('.wamp',{ eventPassthrough: true, scrollX: true, scrollY: false, preventDefault: false , click: true});
        var num = ($('.scenic-num').children().length-1)*3.75;
        $('.iscoll').css('width', num+'rem');
        myScroll.refresh();
        
        $('.sales-sect').on('click', 'li a', function(event){
            $(this).parent().addClass('active').siblings().removeClass('active');
            var id = $(this).attr('href');
            var height = $('.am-sticky-placeholder').height();
            $('html,body').animate({scrollTop:$(id).offset().top-height}, 500);
            event.preventDefault();
            event.stopPropagation();
        });
    });
</script>